import { formateDate } from "./util_base_time.js"
import { inStorage } from "./public_base_util.js"

//获取yyyy-mm-dd类型时间
let getDate = value => {
	return formateDate("yyyy-MM-dd",value);
}
//获取yyyy-mm-dd hh:mm类型时间
let getDateDeal = value => {
	return formateDate("yyyy-MM-dd hh:mm",value);
}

//获取用户角色描述
let getUserDes = value => {
	let userType =  inStorage("get","userType");
	userType.forEach((str,idx,arr) => {
		if(str.type == value){
			value = str.describ
		}
	})
	return value;
}

//身份证中间过滤
let getUserCardId = value => {
	var leng = value.length
	value = value.substr(0, 6) + '******' + value.substr(leng - 6);
	return value;
}

//获取数据字典模块添加类型
let wordBookVal = value => {
	let wordBook =  inStorage("get","wordBook");
	wordBook.forEach((str,idx,arr) => {
		if(str.type == value){
			value = str.describ
		}
	})
	return value;
}


export { getDate,getDateDeal,getUserDes,getUserCardId,wordBookVal }
